package com.futureCloudMOM.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.futureCloudMOM.core.base.service.impl.BaseServiceImpl;
import com.futureCloudMOM.core.domain.BasicProcess;
import com.futureCloudMOM.core.service.BasicProcessService;
import com.futureCloudMOM.core.mapper.BasicProcessMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 【Basic_Process】的数据库操作Service实现
*
* @author Administrator
* @since 2023-06-06 15:19:30
*/
@Service
public class BasicProcessServiceImpl extends BaseServiceImpl<BasicProcessMapper, BasicProcess> implements BasicProcessService{

    @Override
    public List<BasicProcess> getProcessByNameAndCode(BasicProcess process) {
        return list(new LambdaQueryWrapper<BasicProcess>()
        .eq(BasicProcess::getDeleted,0)
        .like(ObjectUtils.isNotEmpty(process.getName()),BasicProcess::getName,process.getName())
        .like(ObjectUtils.isNotEmpty(process.getCode()),BasicProcess::getCode,process.getCode())
        .orderByDesc(BasicProcess::getSysCreateTime)
        );
    }
}
